﻿using Microsoft.EntityFrameworkCore;
using System;
using Domin;
using Helps;
using Pomelo.EntityFrameworkCore.MySql;
using Microsoft.Extensions.Configuration;

namespace EF_Cord
{
    public class MyDBCountext:DbContext
    {
        public MyDBCountext(DbContextOptions<MyDBCountext> options) : base(options) { }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            string connstr = AppConfigurtaionServices.Configuration.GetConnectionString("MySql");
            optionsBuilder.UseMySql(connstr, ServerVersion.AutoDetect(connstr));
            base.OnConfiguring(optionsBuilder);
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

        }
        public DbSet<Peoples> Peoples { get; set; }
        public DbSet<Roles> Roles { get; set; }
        public DbSet<Havs> Havs { get; set; }

    }
}
